#ifndef ELEMENTS_ITEM_FIELD_H
#define ELEMENTS_ITEM_FIELD_H

#include "element.h"

namespace Elements
{

struct ItemField : public Element
{
    ItemField() = default;
    ItemField(const ItemField& other);

    // -- Интерфейс элемента -- //

    virtual bool isSame(Element* const other) const override;

    virtual Common::Json toJson() const override;
    virtual void fromJson(const Common::Json& json) override;

    virtual Element* clone() const override;
    virtual ElementType elementType() const override;

    // -- Интерфейс данных -- //

    unsigned itemId() const;
    void setItemId(unsigned value);

    unsigned fieldTypeId() const;
    void setFieldTypeId(unsigned value);

    std::string value() const;
    void setValue(const std::string& value);

    std::string searchValue() const;
    void setSearchValue(const std::string& value);

private:
    unsigned m_itemId = 0;
    unsigned m_fieldTypeId = 0;
    std::string m_value;
    std::string m_searchValue;
};

typedef std::shared_ptr<ItemField> ItemFieldPtr;
typedef std::vector<ItemFieldPtr> ItemFields;

} // namespace Elements

#endif // ELEMENTS_ITEM_FIELD_H
